package com.lili.collection.core.config;

import cn.hutool.core.lang.Singleton;
import com.lili.collection.core.plugins.Plugin;
import com.lili.collection.core.serializer.FastjsonSerializer;

/**
 * 配置
 *
 * @author lili
 * @date 2023/2/13 17:28
 */
public interface Config {

    /**
     * 序列化配置
     */
    default String serialize() {
        return Singleton.get(FastjsonSerializer.class).serialize(this);
    }

    /**
     * 反序列化配置
     */
    default Object deserialize(String value) {
        return Singleton.get(FastjsonSerializer.class).deserialize(value);
    }

    /**
     * 获取插件
     */
    Plugin getPlugin();
}
